package com.hp.team.bookstore.dbutil.dao;

import java.io.Serializable;
import java.util.List;

/**
 * A super interface for common CRUD functionality. As for most ORM solutions,
 * identifier types have to be serializable.
 * 
 * https://community.jboss.org/wiki/GenericDataAccessObjects
 * 
 */
public interface GenericDAO<T, ID extends Serializable> {

	T findById(ID id, boolean lock);

	List<T> findAll();

	List<T> findByExample(T exampleInstance, String... excludeProperty);

	T makePersistent(T entity);

	void makeTransient(T entity);

	Long count();
}
